﻿using System;
using System.Collections.Generic;
using System.Reflection;

namespace DPL.CodeExplorer.ReflexionExplorer
{
    /// <summary>
    /// A class to explore DLL binary code and extract concept and relationships
    /// </summary>
    public class AssemblyExplorer
    {
        public List<TypeExplorer> allTypeExplorers = new List<TypeExplorer>(); 
        public AssemblyExplorer(Assembly anAssembly)
        {
            foreach(Type aType in anAssembly.GetTypes())
            {
                // Avoid Anonymous types that complexify the analysis without any extra value
                if (!aType.FullName.Contains("f__AnonymousType"))
                {
                    TypeExplorer aTypeExplorer = new TypeExplorer(aType);
                    allTypeExplorers.Add(aTypeExplorer);
                }
            }
        }
    }
}
